Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 3 - Image Compression Manager / Image Compression Manager Reference
Image Compression Manager Functions / Working With Pictures and PICT Files


CompressPictureFile

The CompressPictureFile function compresses a single-frame image stored as a picture file (PICT file) and places the result in another picture file.

pascal OSErr CompressPictureFile (short srcRefNum, 
                                  short dstRefNum, 
                                  CodecQ quality, 
                                  CodecType cType);
srcRefNum
Contains a file reference number for the source PICT file.
dstRefNum
Contains a file reference number for the destination PICT file. Note that the compressor overwrites the contents of the file referred to by dstRefNum. You must open this file with write permission. The destination file can be the same as the source file specified by the srcRefNum parameter.
quality
Specifies the desired compressed image quality. See "Compression Quality Constants" on page 3-57 for available values.
cType
Specifies a compressor type. You must set this parameter to a
valid compressor type (see Table 3-3 on page 3-64 for a list of the available compressor types). If the value passed in is 0, or 'raw ', and the source picture is compressed, the destination picture is created as an uncompressed picture and does not require QuickTime to be displayed.
DESCRIPTION
The CompressPictureFile function compresses only image data. Any other types of data in the file, such as text, graphics primitives, and previously compressed images, are not modified in any way and are passed through to the destination picture. This function does not use the graphics port.

This function supports parameters governing image quality and compressor type. The compressor infers the other compression parameters from the image data in the source picture file.

SPECIAL CONSIDERATIONS
The CompressPictureFile function doesn't compress pictures that contain compressed data. Do not alter data in pictures that are already compressed. Instead use FCompressPictureFile, described in the next section.

RESULT CODES
noErr0No error
paramErr-50Invalid parameter specified
memFullErr-108Not enough memory available
noCodecErr-8961The Image Compression Manager could not find the specified compressor
File Manager errors

SEE ALSO
If you need more control over the compression operation, use the FCompressPictureFile function.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996